<style>
    #org_table tr.selected td {
        background-color: #ddeaf0;
    }
</style>

<div class="col-lg-4">
    <div class="panel">
        <div class="panel-heading">
            Organisations
        </div>

        <div class="panel-body no-padder">
            <table id="org_table" class="table table-condensed table-striped table-hover m-b-none">
                <thead>
                    <tr>
                        <th colspan="2">Name</th>
                        <!--<th>Members</th>
                        <th>Categories</th>-->
                        <!--<th class="text-right">Registered</th>-->
                        <th class="text-center">Action</th>
                    </tr>
                </thead>


                <tbody>
                    <?php
                    $count = 1;
                    foreach ($organisations as $organisation) {
                        ?>
                        <tr>
                            <td width="40" class="text-right"><?php echo $count++; ?>.</td>
                            <td>
                                <a class="btn-block" href="<?php echo $this->Html->url(array('action' => 'organisation', $organisation['Organisation']['id'])); ?>" title="View Organisation">
                                    <?php echo $organisation['Organisation']['name']; ?>
                                </a>
                            </td>

                            <!--<td class="text-center"><?php echo $organisation['Organisation']['members']; ?></td>-->
                            <!--<td><?php echo $organisation['Organisation']['categories']; ?></td>-->
                            <!--<td class="text-right"><?php echo date('jS M, Y', strtotime($organisation['Organisation']['created'])); ?></td>-->

                            <td align="center">
                                <!--<button class="btn btn-success btn-xs" title="View Organisation"><i class="fa fa-search"></i></button>-->
                                <!--<button class="btn btn-info btn-xs" ><i class="fa fa-pencil"></i></button>-->
                                
                                <?php $active_class = $organisation['Organisation']['active'] == 1 ? 'btn-success' : 'btn-warning'; ?>
                                
                                <button class="btn btn-xs disable-btn <?php echo $active_class; ?>" 
                                        data-active="<?php echo $organisation['Organisation']['active']; ?>" 
                                        data-id="<?php echo $organisation['Organisation']['id']; ?>" title="Enable/Disable Organisation">
                                    <i class="fa fa-check"></i>
                                </button>
                                
                                <!--<button class="btn btn-xs delete-btn btn-danger" 
                                        data-id="<?php echo $organisation['Organisation']['id']; ?>" title="Delete Organisation">
                                    <i class="fa fa-trash-o"></i>
                                </button>-->
                                
                                <input type="hidden" id="organisation_activate_url" value="<?php echo $this->Html->url(array('action' => 'organisation_activate')); ?>" />
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>

        <div class="panel-footer">

        </div>
    </div>
</div>

<div class="col-lg-7">
    <div class="panel">
        <div class="panel-heading">
            Organisation Details
        </div>

        <div class="panel-body" id="org_details_body">

            <p class="text-center">Select organisation on left to load details</p>

        </div>
    </div>
</div>

<?php echo $this->Html->script('app/views/support/index.js'); ?>